/**
 * 
 */
package com.feib.stms.dao;


import java.util.List;

import com.feib.stms.model.Securities;
import com.feib.stms.pagination.PaginatedList;

/**
 * @author Jimmy Liu
 *
 */
public interface SecuritiesDao 
{
	/**
	 * 以券商代號查詢
	 * @param securitiesNo 券商代號
	 * @return
	 */
	public Securities getBySecuritiesNo(String securitiesNo);

	/**
	 * 以券商主鍵值查詢
	 * @param parentSecuritiesPk 主鍵
	 * @return
	 */
	public Securities getBySecuritiesPk(Long parentSecuritiesPk);
	
	/** 新增
	 * @param securities
	 * @return
	 */
	public int insert(Securities securities);
	
	/** 修改
	 * @param securities
	 * @return
	 */
	public int update(Securities securities);

	/**
	 * 查詢母公司Pk
	 * @param groupPk
	 * @return
	 */
	public long findParentSecuritiesPk(Long groupPk);
	
	/**
	 * 查詢分公司情況
	 * @param securities
	 * @return
	 */
	public PaginatedList<Securities> findForPaginatedListBySecurities(Securities securities, PaginatedList paginatedList);
	
	/** 
	 * 根據pk查詢分公司情況
	 * @param securitiesPk
	 * @return Securities
	 */
	public Securities findSecuritiesBySecuritiesPk(Long securitiesPk);

	/**
	 * 根據券商代號查詢券商資料
	 * @param securitiesNo
	 * @return
	 */
	public List<Securities> findSecuritiesBySecuritiesNos (List<String> securitiesNo);
	
	/**
	 * 根據群組取得可處理券商資料
	 * @param userGroupPk
	 * @return
	 */
	public List<Securities> findSecuritiesByGroupPk(List<String> userGroupPk);
	
	/**
	 * 取得所有<strong>分公司</strong>資料。
	 * @param userGroupPk
	 * @return
	 */
	public List<Securities> findAllSecurities();
	
	/**
	 * 取得所有資料
	 * @return
	 * @author Jimmy Liu
	 */
	public List<Securities> loadAll();
	
	/**
	 * 根據分公司資料尋找分公司
	 * @param securities
	 * @return
	 */
	public Securities findSecuritiesPkBySecurities(Securities securities);
	
	/** 查詢SecuritiesNo是否重複 --新增使用
	 * @param SecuritiesNo
	 * @return
	 */
	public int countSecuritiesNo(String securities_No);
	
	/**
	 * 以券商代號及所屬群組Pk查詢
	 * @param securitiesNo 券商代號
	 * @param groupPk 所屬群組Pk
	 * @return
	 */
	public Securities getBySecuritiesNoAndGroupPk(String securitiesNo, Long groupPk);
	
	public PaginatedList<Securities> findForPaginatedListNotBank(Securities securities, PaginatedList paginatedList);

}
